//集成appjs中方法及属性
var http = require('../../../../service/http.js'); //请求类
var util = require('../../../../utils/util.js'); //工具类

const app = getApp();
var rd_session = '';
Page({

  /**
   * 页面的初始数据
   */
  data: {
    //---当前页名称--------------
    pageName: 'order',
    //----------登录操作-----------------
    isAuthorization: false, //是否授权登录
    isFollowChat: '', //是否关注了咱加 0:未关注/1:已关注/2:已取消关注
    guideAttention: false, //是否需要引导关注
    showPage: false, //是否展开页面
    productId: '', //商品itemid

    productObj: '',
    timeId: '',
    isshow: false, //是否显示遮罩层
    showOffAccount: false, //平台遮罩层
    maskHeight: 0, //遮罩层高度
    hasAddress: false,
    animationData: '', //添加地址信息
    animationData2: '', //地址列表
    ismask: false, //是否显示遮罩层
    animationData3: '', //选择配送方式
    addCode: false,
    agree: '', //是够允许获取微信地址
    defaultAddress: {}, //默认收货地址(用于展示)
    buyerMemo: '', //用户留言
    buyerMemoLength: 0, //用户留言备注

    hasLimit: false, //是否含有限购商品，

    hasUnvalid: false, //是否有失效商品
    //------------结算商品列表-参数--------------------
    submitOrderNoPay: false, //只提交订单不支付
    cartProducts: [], //结算商品列表
    total: '', //商品总额
    orderId: '', //订单id
    sendMessage: true, //是否发送短信给收货人
    //-----------根据订单id查看状态、地址----------------
    status: 10, // 10 为初始值
    orderTime: '', //创建时间
    ispay: false, //是否点击支付
    //点击开启的动画------------------
    isExpress: false, //配送方式的动画
    isShipping: false, //选择配送方式的动画
    cartProduct: {}, //单个商品
    index: '', //当前正在操作代付款商品的下标
    //--------------优惠券信息---------------------------
    discountCardList: [], //优惠券列表信息
    cardIdStr: '', //已选择的优惠券id拼接
    couponInfouserId: '', //优惠券id
    couponPrice: 0, //优惠金额
    //--------------服务条款----------------------------
    agreeNotes: false, //同意服务条款同意后才能付款
    isVip: '', //是否是vip
    //---登录后有无优惠券---
    couponInfo: '', //订单详情可用优惠券信息{}
    selectCoupon: '', //已选优惠券信息{}
    couponPrice: '', //订单新人特惠-优惠金额

    fullTotal: '', //满减总额
    fullCutAmount: '', //满减金额

    totalPrice: '', //商品总计
    totalDisCountPrice: '', //优惠总计

    // 商品留言
    productLevMsgs: [], //商品留言[]
    showLevMsgs: false, //查看留言
    errMsgAnimationData: '', //展示提示窗动画
    //订单备注
    hideAreaHolder: false, //是否现实输入文本域placehoder
    //拼团id
    zjGroupLevelId: '', //拼团id
    shareAnimation: '', //分享拼团商品动画
    showShareMeun: false, //是否展示分享菜单
    orderInfo: '', //根据订单id 查订单信息 groupEndTime activityStatus
    isGroupProduct: '', //是否是拼单订单

    // 活动商品减免
    activeDisCountObj: {},//满足活动列表 total:'',activeDisCountList[]
    activeDisCountList:[],//满减优惠列表
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function(options) {
    console.log("order--onLoadJs", options);

    this.setData({
      orderId: options.orderId || this.data.orderId,
      productLevMsgs: app.data.productLevMsgs,
      zjGroupLevelId: app.data.zjGroupLevelId
    })
    app.clearSelectCoupon(); //清除已选优惠券信息
    if (!options.orderId) { //没有选择
      this.getShopCoupon();
    }
    console.log('orderjs-shopinfo', wx.getStorageSync('shopInfo'));
  },
  onShow: function() {
    console.log('isFollowChat=', this.data.isFollowChat);
    console.log('isshow=', this.data.isshow);
    console.log('guideAttention=', app.data.guideAttention);

    if (app.data.shopInfoTimeOut === true) { //非分享且已经过期，清除店铺信息
      console.log('店铺信息已过期，重新加载 app.checkSession()');
      app.checkSession();
    }
    rd_session = wx.getStorageSync("rd_session");
    util.throttle(this.checkIsFollowUser, 500, rd_session);
    // this.checkIsFollowUser(rd_session);//检查是否已经关注过店铺

    let orderId = this.data.orderId;
    let totalPrice = this.data.totalPrice;
    //获取默认地址
    this.getDefaultAddress();
    //查看有无已选优惠券
    let selectCoupon = app.data.selectCoupon;
    if (selectCoupon) { //有优惠券的时候
      totalPrice = totalPrice - selectCoupon.couponPrice;
      this.getMoreDiscountPrice(totalPrice); //根据商品总计 - 优惠券金额 查询会员优惠和满减
    }

    this.setData({
      isBindPhone: app.data.isBindPhone,
      isAuthorization: app.data.isAuthorization,
      shopName: app.data.shopName,
      selectCoupon: app.data.selectCoupon,
    })
    //------------判断有无订单，有则为待付款订单----------------------------------
    if (orderId) {
      this.getListByOrderId(orderId); //根据订单id查订单
    } else if (!selectCoupon && !orderId) { //没有订单号和已选优惠券
      this.getCartList(orderId);
    }
  },
  /**
   * 获取优惠券
   */
  getShopCoupon: function() {

    let getTotalTask = setInterval(() => {
      let total = this.data.total; //总金额
      if (total != '' && total > 0) {
        clearInterval(getTotalTask);
        app.getShopCoupon(total); //查询有无优惠券+满减
        util.showToast('加载中', 200, 'loading', () => {
          let getShopCouponTask = setInterval(() => {
            let hasCouponInfo = app.data.hasCouponInfo;
            let couponInfo = app.data.couponInfo;
            if (hasCouponInfo !== '') {
              clearInterval(getShopCouponTask);
              console.log('couponInfo', couponInfo);
              this.setData({
                couponInfo: couponInfo,
                hasCouponInfo: hasCouponInfo,
              })
            }
          }, 200)
        });
      }
    }, 200)
  },


  getListByOrderId: function(orderId) { // 根据订单号查订单商品列表


    //----------------------根据订单返回商品信息------------------------------
    http.getReq('/weixin/getOrder/ByOrderId', {
      orderId: orderId
    }, (res) => {
      console.log('加载订单商品成功', res);

      //判断订单状态
      let status = res.status; //订单状态
      let address = res.address; //订单地址
      let orderTime = res.orderTime; //创建时间
      let total = res.total; //订单总额
      let buyerMemo = res.buyerMemo; //留言备注
      let productLevMsgs = res.productLevMsgs; //用户自定义留言
      for (let i = 0; i < productLevMsgs.length; i++) {
        let msgItem = productLevMsgs[i];
        productLevMsgs[i].type = app.getLevMsgType(msgItem.fieldType);
      }
      console.log('订单状态' + status + '---' + address + '---' + orderTime + '---');



      this.setData({
        defaultAddress: address, //默认收货地址
        status: status, //订单状态
        orderTime: orderTime, //创建时间
        total: total,
        hasAddress: true, //有地址
        buyerMemo: buyerMemo, //用户留言
        orderId: orderId, //订单id
        cartProducts: res.data, //代付款商品列表
        showPage: true,
        isVip: wx.getStorageSync('vip'), //是否是vip
        couponPrice: res.couponPrice, //优惠金额
        fullTotal: res.fullTotal ? res.fullTotal : 0,
        fullCutAmount: res.fullCutAmount ? res.fullCutAmount : 0,
        totalPrice: res.totalPrice,
        totalDiscount: res.totalDiscount,
        totalDisCountPrice: res.totalDiscount,
        vipDiscountMoney: res.vipDiscountMoney,
        productLevMsgs: productLevMsgs,
        orderInfo: res,
        isGroupProduct: res.isGroupProduct,
        activeDisCountObj: res.zjFullDiscountVo
      })
    });

  },

  getCartList: function(orderId) { //获取待付款商品列表

    let cartProducts = this.data.cartProducts
    if (cartProducts.length <= 0) { //立即购买的商品
      cartProducts = app.data.cartProducts
    }
    console.log('获取待付款商品列表', cartProducts);
    this.setData({
      isGroupProduct: cartProducts[0].isGroupProduct // 是否是拼团商品
    })
    //---------------------计算商品总额------------------------------------
    //获取所有商品会员优惠券之前的商品总计
    this.getTotalPrice(cartProducts);
  },

  //获取商品优惠前总计
  getTotalPrice: function(cartProducts) {
    let totalPrice = 0; //订单总价
    let totalCouPrice = 0; //商品优惠总价
    let totalFstOdDisCount = 0; //首单立减商品
    let hasLimit = false; //是否含有限购商品，
    let hasUnvalid = false; //是否有失效商品
    let tatalGroupLeaderDiscount = 0; //团长优惠价
    let tatalItemCutLimitCouponPrice = 0; //单个商品优惠券（直接减2.20）
    for (let item of cartProducts) {
      totalCouPrice += item.couponPrice || 0;
      totalPrice += item.tPrice || 0;
      totalFstOdDisCount += item.newOrderDiscount || 0;
      tatalGroupLeaderDiscount += item.groupLeaderDiscount || 0;
      tatalItemCutLimitCouponPrice += item.itemCutLimitCouponPrice || 0;
      //查看有误失效和限购商品
      if (item.isLimited == '1') {
        hasLimit = true; //是否含有限购商品， = true;
      }
      if (item.isValid == 0) {
        hasUnvalid = true; //是否含有失效商品， = true;
      }
    }
    if (totalCouPrice > 0) {
      totalPrice = totalPrice - totalCouPrice;
    }
    if (totalFstOdDisCount > 0) {
      totalPrice = totalPrice - totalFstOdDisCount;
    }

    // 团长优惠价格
    if (tatalGroupLeaderDiscount > 0) {
      totalPrice = totalPrice - tatalGroupLeaderDiscount;
    }

    if (tatalItemCutLimitCouponPrice > 0) {
      totalPrice = totalPrice - tatalItemCutLimitCouponPrice;
    }
    console.log(totalCouPrice, totalFstOdDisCount, tatalGroupLeaderDiscount, tatalItemCutLimitCouponPrice);
    console.log('第一次计算totalPrice', totalPrice);
   
    this.setData({
      cartProducts: cartProducts,
      hasLimit: hasLimit, //是否含有限购商品，
      hasUnvalid: hasUnvalid, //是否含有失效商品
      totalPrice: parseFloat(totalPrice).toFixed(2),
      showPage: true,
    })

    console.log('before  getActivityDisCount-', totalPrice);
    //获取活动减免
    this.getActivityDisCount(cartProducts).then(res => {
      
      let fullDisCountTotal = res.fullDisCountTotal;//减免总金额 （计入优惠总计，不计入商品总计）
      if (fullDisCountTotal > 0){
        totalPrice = totalPrice - fullDisCountTotal;
      }
      this.setData({
        activeDisCountObj: res,//满足活动列表 total:'',activeDisCountList[]
      })
      this.getMoreDiscountPrice(totalPrice); //获取更多订单减免项
    
    })

    //获取更多优惠价格
    
  },
  /**
   * 获取活动减免
   */
  getActivityDisCount: function(cartProducts) {
    return new Promise((resolve, reject) => {

      http.getReq('/weixin/FullDisCountList/getCountMoney', {
        productList: cartProducts,
      }, (res) => {
        console.log('getActivityDisCount', res);
        resolve(res);

      })
    })
  },
  //获取满减优惠
  getMoreDiscountPrice: function(totalPrice = this.data.totalPrice) {

    http.getReq('/weixin/couponInfo/getVipDisCountAndFullCut', {
      rdSession: rd_session,
      total: parseFloat(totalPrice).toFixed(2)
    }, (res) => {
      console.log('getMoreDiscountPrice', res);
      if (res.ret) {

        let fullCutAmount = res.data.fullCutAmount || 0;
        let fullTotal = res.data.fullTotal || 0;
        let vipDiscountMoney = res.data.vipDiscountMoney || 0;
        let totalDisCountPrice = 0; //优惠总计
        let selectCoupon = app.data.selectCoupon; //已选优惠券
        let couponPrice = 0; //优惠券金额
        let activeDisCountTotal = this.data.activeDisCountObj.fullDisCountTotal || 0;
        console.log('selectCoupon', selectCoupon);
        
        if (selectCoupon) { //如果有优惠券 不取减优惠券之后的查询金额totalPrice
          couponPrice = selectCoupon ? selectCoupon.couponPrice : 0;
        }
        totalPrice = this.data.totalPrice;
        console.log(fullCutAmount, vipDiscountMoney, couponPrice);
        totalDisCountPrice = fullCutAmount + vipDiscountMoney + couponPrice + activeDisCountTotal;
        console.log('totalPrice', totalPrice);
        this.setData({
          fullCutAmount: fullCutAmount,
          fullTotal: fullTotal,
          vipDiscountMoney: vipDiscountMoney, //会员优惠
          totalPrice: parseFloat(totalPrice).toFixed(2),
          total: (totalPrice - vipDiscountMoney - fullCutAmount - couponPrice - activeDisCountTotal).toFixed(2), //合计（结算价格）
          isVip: wx.getStorageSync('vip'),
          totalDisCountPrice: totalDisCountPrice, //满减总计
        })
      }
    })
  },
  //查看是否有满减
  checkFullCutAmount: function(total) {
    let checkFullCutAmountTask = setInterval(() => {
      let hasCouponInfo = this.data.hasCouponInfo;
      let fullCutAmount = this.data.fullCutAmount;
      if (fullCutAmount !== '') {
        clearInterval(checkFullCutAmountTask);
        if (fullCutAmount > 0) {
          total = total - fullCutAmount;
        }
        this.setData({
          total: total.toFixed(2)
        })
      }
    }, 200)
  },
  //--------------获取.page节点高度，设置#高度mask ----------
  getMaskHeight: function(e) {
    wx.createSelectorQuery().select('.page').boundingClientRect(function(rect) {
      // 节点的高度
      console.log(rect);
      return rect.height
    }).exec()
  },
  cancelAnimation: function(e) { //取消按钮
    console.log(e);
    app.cancelAnimation();
    this.setData({
      animationData3: app.data.animationData,
    })

    setTimeout(() => {
      this.setData({
        animationData3: app.data.animationData,
        isshow: false,
        isExpress: false,
        isShipping: false,
      })
    }, 300)

  },
  //选择配送方式
  chooseShipMethod: function(e) {
    console.log(e);
    let index = e.currentTarget.dataset.index;
    let cartProducts = this.data.cartProducts;
    let cartProduct = cartProducts[index];
    app.makeAnimation();
    this.setData({
      animationData3: app.data.animationData,
      isshow: true,
      isShipping: true,
      cartProduct: cartProduct,
      index: index, //当前正在操作代付款商品的下标
    })
    setTimeout(function() {
      this.setData({
        animationData3: app.data.animationData,
      })
    }.bind(this), 300)
  },

  wxPay: function(e) { //提交订单

    let isAuthorization = app.data.isAuthorization;
    let orderId = this.data.orderId; //判断订单是否有orderId
    let [submitOrderNoPay, ispay] = ['', true]; //提交订单并没有付款/点击提交订单按钮
    let [isFollowChat, guideAttention] = [this.data.isFollowChat, app.data.guideAttention];

    if (isFollowChat != '1' && guideAttention == true) { //引导关注
      this.setData({
        isshow: true
      })
      console.log('isFollowChat:' + isFollowChat + '  guideAttention:' + guideAttention + " isshow-" + this.data.isshow);
      util.showToast('用户需要关注咱加公众号后才能支付', 1500, 'none');
      return
    }
    this.setData({ //改变提交按钮状态
      ispay: ispay
    })
    if (isAuthorization === true) { //已登录
      if (!orderId) {
        wx.showModal({
          title: '确认支付',
          content: '订单总计' + this.data.total + '元',
          showCancel: true,
          cancelText: '取消',
          confirmText: '确定',
          success: (res) => {
            if (res.confirm) { //提交订单直接支付
              submitOrderNoPay = false;
            } else { //提交订单取消支付，不支付
              submitOrderNoPay = true;
            }
            //设置本地变量 调用接口
            this.setData({
              ispay: ispay, //按钮状态 可选，（重置可确认支付）
              submitOrderNoPay: submitOrderNoPay
            })
            app.wxPay(e, this); //提交订单调用支付接口
          }
        })

      } else {
        this.setData({
          ispay: true, //按钮状态 可选，（重置可确认支付）
          submitOrderNoPay: false
        })
        app.wxPay(e, this); //提交订单调用支付接口
      }

    } else { //返回首页登录
      app.SessionTimeOut()
    }
  },

  backToHome: function(e) { //返回到首页
    app.backToHome(this);
  },
  //是否短信通知收货人
  sendMessage: function(e) {
    console.log(e);
    let sendMessage = e.detail.value; //sendMessage 返回true 或false;
    this.setData({
      sendMessage: sendMessage
    })
  },
  //------------------未开通服务提示----------------------
  unOpen: function() {
    app.unOpen();
  },
  //----数量超出提示--------------------------------------
  hasLimitProTip: function() {
    util.showToast('订单中的商品超出限购数量，请编辑后重试', 1500, 'none', function() {});
  },
  // 设置地址页面
  toSetAddressPage: function(e) {
    wx.navigateTo({ //跳转设置地址页面
      url: '../setAddress/setAddress',
    })
  },
  //一键复制订单号：
  copyText: function(e) {
    util.copyText(e);
  },

  selectShip: function(e) { //选择配送方式
    let methodCode = e.currentTarget.dataset.methodcode; //配送id
    let methodName = e.currentTarget.dataset.methodname; //配送名称
    let cartProducts = this.data.cartProducts;
    let index = this.data.index;
    let cartProduct = cartProducts[index];
    cartProduct.shippingMethodCode = methodCode;
    cartProduct.shippingMethodName = methodName;
    for (let i = 0; i < cartProducts.length; i++) {
      if (cartProducts[i] == index) {
        cartProducts[i] = cartProduct;
      }
    }

    this.setData({
      cartProducts: cartProducts,
      cartProduct: cartProduct
    })

  },
  validataShip: function() {
    let cartProducts = this.data.cartProducts;
    let shipAllSelect = true;
    for (let i = 0; i < cartProducts.length; i++) {
      if (cartProducts[i].shippingMethodCode == null) {
        shipAllSelect = false;
      }
    }
    if (!shipAllSelect) {
      util.showToast('请选择配送方式', 1000, 'none', function() {
        return shipAllSelect;
      });
    }
    return shipAllSelect;
  },
  //计算输入框输入留言字数
  countMemoLength: function(e) {
    console.log(e);
    this.setData({
      buyerMemoLength: e.detail.cursor
    })
  },
  //备注留言区失去焦点时
  getBuyerMemo: function(e) {
    console.log(e);
    this.setData({
      buyerMemo: e.detail.value,
      hideAreaHolder: this.data.buyerMemoLength > 0 ? true : false
    })
  },
  getFormId: function(e) {
    console.log(e);
    app.getFormId(e);
  },
  //根据商品id 查商品详情
  selectProductById: function(e) {

    console.log('根据商品id 查商品详情参数');
    console.log(e);
    let productId = e.currentTarget.dataset.productid || this.data.productId;
    console.log(productId);
    this.setData({
      productId: productId,
      pageUrl: '/pages/product/product'
    })
    util.throttle(app.selectProductById, 500, this);
  },
  // //选择优惠券
  // selectCoupons: function() {

  // },
  //获取默认地址
  getDefaultAddress: function() {

    let defaultAddress = wx.getStorageSync('defaultAddress') || '';
    console.log('defaultAddress', defaultAddress);
    if (defaultAddress == '') {
      http.getReq('/weixin/userDeliveredInfo/list', {
        rdSession: rd_session
      }, (res) => {
        let addressList = res.data || [];
        console.log(res);
        if (res.data.length > 0) {
          for (let i = 0; i < addressList.length; i++) {
            if (addressList[i].isDefault == '1') {
              defaultAddress = addressList[i];
            }
          }
          this.setData({
            hasAddress: true,
            defaultAddress: defaultAddress
          })
        } else {
          this.setData({
            hasAddress: false
          })
        }
      });
    } else {
      this.setData({
        hasAddress: true,
        defaultAddress: defaultAddress
      })
    }

  },
  //勾选下单须知
  checkOut: function() {
    this.setData({
      agreeNotes: !this.data.agreeNotes, //同意购买须知
    })
  },
  // 跳转预约
  handleBook: function(e) {
    console.log('现在预约');
    console.log(e);
    let itemid = e.currentTarget.dataset.itemid; //商品id
    let skuid = e.currentTarget.dataset.skuid || ''; //skuid
    let eccode = e.currentTarget.dataset.eccode || ''; //卡号信息
    let orderId = this.data.orderId; //订单id
    let defaultAddress = this.data.defaultAddress;


    console.log('itemid', itemid);
    wx.navigateTo({
      url: '/pages/user/pages/bookInformation/bookInformation?itemid=' + itemid + '&bookUser=' + defaultAddress.name + '&bookPhone=' +
        defaultAddress.telNumber + '&skuid=' + skuid + '&orderId=' + orderId + '&eccode=' + eccode,

    })
  },
  /**
   * 查看预约信息
   */
  checkBookInfoByIds: function(e) {
    let itemid = e.currentTarget.dataset.itemid; //商品id
    let skuid = e.currentTarget.dataset.skuid || ''; //skuid
    let orderId = this.data.orderId; //订单id
    wx.navigateTo({
      url: '/pages/user/pages/bookInfoList/bookInfoList?orderId=' + orderId + "&itemid=" + itemid + "&skuid=" + skuid,
    })
  },
  /**
   * 查看开卡信息（优惠次卡）
   */
  toBindCardPage: function(e) {
    let itemid = e.currentTarget.dataset.itemid; //商品id
    let eccode = e.currentTarget.dataset.eccode; //优惠次卡号
    wx.navigateTo({
      url: '/pages/user/pages/bindCouponCard/bindCouponCard?itemid=' + itemid + "&eccode=" + eccode
    });
  },
  //不可预约提示
  unAbleBookTip: function() {
    util.showToast("您的卡还有预约的课程未完成，请完成后再继续预约", 1000, 'none');
  },
  /**
   * 打开咱加优惠券
   */
  toZjCouponPage: function() {
    wx.navigateTo({
      url: '/pages/product/pages/zjCoupon/zjCoupon',
    })
  },
  // 查看留言
  showLevMsgs: function() {
    //创建动画
    var animation = wx.createAnimation({
      duration: 500,
      timingFunction: "ease",
      delay: 0,
      transformOrigin: "50% 50%",
    });
    //第一步先将动画放在要出现之前的位置
    animation.translateY(500).step();
    this.setData({
      errMsgAnimationData: animation.export(),
      showLevMsgs: true,
    })

    setTimeout(() => {
      animation.translateY(0).step();
      this.setData({
        errMsgAnimationData: animation.export(),
      })
    }, 50)
  },
  //关闭留言
  cancelMsgBlock: function() {
    //创建动画
    var animation = wx.createAnimation({
      duration: 500,
      timingFunction: "ease",
      delay: 0,
      transformOrigin: "50% 50%",
    });
    //第一步先将动画放在要出现之前的位置
    animation.translateY(500).step();
    this.setData({
      errMsgAnimationData: animation.export(),
    })

    setTimeout(() => {
      this.setData({
        showLevMsgs: false
      })
    }, 500)
  },
  //预览留言图片
  previewImage: function(e) {
    app.previewImage(e);
  },
  //  控制自定义文本域输入层显示
  hideAreaHolder: function(e) {
    console.log('hideHolder', e);
    this.setData({
      hideAreaHolder: true
    })
  },

  // -------拼团-----------------
  /**
   * 跳转参团页面
   */
  toPinPage: function(e) {
    console.log('跳转拼单商品');
    let orderId = this.data.orderId;

    //shopuid inviter
    //获取当前店铺id 
    let shopInfo = wx.getStorageSync('shopInfo');
    console.log('shopInfo', shopInfo);
    let shopuid = shopInfo.shopuid ? shopInfo.shopuid : '';
    let inviter = wx.getStorageSync('unionid');
    let pinParms = orderId + '/' + inviter + '/' + shopuid + '/0'; //shareKey = 0 拼单用户点击进入
    wx.navigateTo({
      url: '/pages/product/product?pinParms=' + pinParms,
    })
  },
  /**
   * 是否关注过咱加
   */
  checkIsFollowUser: function(rd_session) {
    http.getReq('/weixin/getIsFollowChat', {
      rdSession: rd_session
    }, (res) => {
      console.log('checkIsFollowUser', res);

      this.setData({
        isFollowChat: res.data.isFollowChat,
        guideAttention: app.data.guideAttention,
      })
      if (res.data.isFollowChat == '1') {
        this.setData({
          isshow: false
        })
      }
    })
  }

})